﻿namespace HuaWei.CBR
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Card;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraLayout;
    using DevExpress.XtraTab;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using HuaWei;
    using HuaWei.CommClass;
    using HuaWei.CommComp;
    using HuaWei.Common;
    using HuaWei.DAI;
    using HuaWei.Windows.Forms;
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    public class FrmBGJL : FrmBase
    {
        private bool _flag1 = false;
        private BindingNavigator bindingNavigator2;
        private BindingSource bindingSource;
        private BindingSource bindingSource1;
        private BindingSource bindingSource2;
        private BindingSource bindingSource3;
        private BindingSource bindingSource4;
        private BindingSource bindingSource5;
        private BindingSource bindingSource6;
        private BindingSource bindingSource7;
        private BindingSource bindingSource8;
        private ButtonEdit buttonEdit;
        private CardView cardView1;
        private CardView cardView2;
        private CardView cardView3;
        private CheckEdit ceTYSB;
        private GridColumn colBDS;
        private GridColumn colBGHSL;
        private GridColumn colBGZJL;
        private GridColumn colBQJL;
        private GridColumn colBQJLS;
        private GridColumn colBQMJL;
        private GridColumn colBW;
        private TreeListColumn colCBMC;
        private GridColumn colCT;
        private GridColumn colCT1;
        private GridColumn colDW;
        private TreeListColumn colHTJE;
        private TreeListColumn colHTSL;
        private GridColumn colHTSL1;
        private TreeListColumn colID;
        private GridColumn colJSJG;
        private GridColumn colJSS;
        private GridColumn colMC;
        private GridColumn colPZBH;
        private GridColumn colQDBH;
        private TreeListColumn colQDBH1;
        private GridColumn colQDMC;
        private GridColumn colQQZH;
        private GridColumn colSL;
        private GridColumn colSQMJL;
        private GridColumn colTZBH;
        private GridColumn colXMMC;
        private TreeListColumn colZBDJ;
        private HuaWei.Common.dataSets1 dataSets1;
        private TextEdit edtBGLH;
        private TextEdit edtBGTH;
        private TextEdit edtBW;
        private TextEdit edtPZBH;
        private TextEdit edtQQZH;
        private TextEdit edtTZBH;
        private GridColumn gridColumn1;
        private GridControl gridControl;
        private GridControl gridControl1;
        private GridControl gridControl2;
        private GridControl gridControl3;
        private GridControl gridControl5;
        private GridControl gridQDJL_CT;
        private GridView gridView1;
        private GridView gridView2;
        private GridView gridView3;
        private GroupControl groupControl1;
        private GroupControl groupControl2;
        private GroupControl groupControl3;
        private GroupControl groupControl4;
        private GroupControl groupControl5;
        private GroupControl groupControl6;
        private GridColumn iAnFljdXyH;
        private IContainer icontainer1 = null;
        private ImageList imageList;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private LabelControl labelControl6;
        private LabelControl labelControl7;
        private LayoutControlItem layoutControlItem8;
        private LabelControl lblBGLH;
        private MemoEdit memoEdit1;
        private PanelControl mtgaywZhr;
        private PanelControl panelControl1;
        private PanelControl panelControl3;
        private PanelControl panelControl4;
        private PanelControl panelControl5;
        private PanelControl panelControl7;
        private PictureEdit pictureEdit1;
        private RepositoryItemImageComboBox repositoryItemImageComboBox1;
        private RepositoryItemImageComboBox repositoryItemImageComboBox2;
        private RepositoryItemPictureEdit repositoryItemPictureEdit1;
        private RepositoryItemPictureEdit repositoryItemPictureEdit2;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private RepositoryItemTextEdit repositoryItemTextEdit3;
        private SplitterControl splitterControl2;
        private SplitterControl splitterControl3;
        private TextEdit textEdit;
        private ToolStripButton toolStripButton1;
        private ToolStripButton toolStripButton10;
        private ToolStripButton toolStripButton4;
        private ToolStripButton toolStripButton5;
        private ToolStripButton toolStripButton6;
        private ToolStripButton toolStripButton7;
        private ToolStripButton toolStripButton8;
        private ToolStripButton toolStripButton9;
        private ToolStripLabel toolStripLabel1;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripSeparator toolStripSeparator2;
        private ToolStripSeparator toolStripSeparator3;
        private ToolStripSeparator toolStripSeparator4;
        private ToolStripSeparator toolStripSeparator5;
        private ToolStripSeparator toolStripSeparator6;
        private ToolStripSeparator toolStripSeparator7;
        private ToolStripTextBox toolStripTextBox1;
        private ToolTipController toolTipController;
        private TreeList trJLQD;
        private XtraTabControl xtraTabControl2;
        private XtraTabPage xtraTabPage3;
        private XtraTabPage xtraTabPage4;

        //-1:承包人
        //0：监理
        //1：业主
        public int Type { get; set; }
        public FrmBGJL(int type = -1)
        {
            try
            {
                this.InitializeComponent();
                Type = type;
                this.LoadData();
                SetEnabled(!this.edtPZBH.Properties.ReadOnly);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void bindingSource_PositionChanged(object sender, EventArgs e)
        {
            string key = DHelp.GetObjValue(this.bindingSource2, "qdbh", false);
            this.method11();
            this.bindingSource2.Position = DHelp.BSFind(this.bindingSource2, "qdbh", key);
            SetEnabled(!this.edtPZBH.Properties.ReadOnly);
        }

        private void bindingSource_PositionChanged1(object sender, EventArgs e)
        {
            this.ControlFormStatus();
            this.method17();
        }

        private void bindingSource5_AddingNew(object sender, AddingNewEventArgs e)
        {
            this.bindingSource.EndEdit();
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
            BindingSource source = (BindingSource)sender;
            DataRowView view2 = ((DataView)source.List).AddNew();
            view2["id"] = Guid.NewGuid();
            view2["pid"] = dataRow["ID"];
            if (source.Count == 1)
            {
                source.EndEdit();
            }
            source.MoveLast();
            e.NewObject = dataRow;
        }

        private void buttonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            this.buttonEdit.Text = "";
            this.method8(false);
        }

        private void buttonEdit_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.method8(false);
            }
        }

        private void cardView3_DoubleClick(object sender, EventArgs e)
        {
            if (this.bindingSource1.List.Count > 0)
            {
                string str = (this.bindingSource1.Current as DataRowView).Row["ID"].ToString();
                this.method10(str);
                this.xtraTabControl2.SelectedTabPageIndex = 1;
            }
        }

        private void cardView3_MouseMove(object sender, MouseEventArgs e)
        {
        }

        private void ceTYSB_EditValueChanging(object sender, ChangingEventArgs e)
        {
            if (e.NewValue.Equals(1))
            {
                if (!this.Check())
                {
                    e.Cancel = true;
                }
                else
                {
                    if (Type == 0 || Type == 1)
                    {
                        DataTable table = base.ds.Tables["BGQDJL_M"];
                        foreach (DataRow row in table.Rows)
                        {
                            row["SPZT"] = Type;
                            row.EndEdit();
                        }
                    }
                    DevCCHelp.ControlForm(base.Controls, true, 1);
                    SetEnabled(false);
                }
            }
            else
            {
                if (Type == 0 || Type == 1)
                {
                    DataTable table = base.ds.Tables["BGQDJL_M"];
                    foreach (DataRow row in table.Rows)
                    {
                        row["SPZT"] = Type - 1;
                        row.EndEdit();
                    }
                }
                DevCCHelp.ControlForm(base.Controls, false, 1);
                SetEnabled(true);
            }
        }

        private void SetEnabled(bool canUse)
        {
            this.lblBGLH.Appearance.Options.UseForeColor = canUse;
            this.gridControl.UseEmbeddedNavigator = canUse;
            this.gridControl3.UseEmbeddedNavigator = canUse;
        }

        public override bool Check()
        {
            if (this.edtPZBH.Text.Equals(""))
            {
                MsgBox.ShowMsg("凭证编号不能为空，请修正后继续！");
                return false;
            }
            string objId = DHelp.GetObjId(this.bindingSource);
            string condition = string.Format("BDID='{0}' and qcid='{2}' and id <> '{1}'", GParams._BDID, objId, GParams.QCInfo.QCID);
            string condition1 = string.Format("BDID='{0}' and qcid='{1}'", GParams._BDID, GParams.QCInfo.QCID);
            if (DBHelp.Unique("BGQDJL_M", "PZBH", this.edtPZBH.Text, condition) || DBHelp.Unique("QDJL_M", "PZBH", this.edtPZBH.Text, condition1))
            {
                MsgBox.ShowMsg("当前凭证编号已经存在，请修正后继续！");
                return false;
            }
            if (this.bindingSource2.List.Count.Equals(0))
            {
                MsgBox.ShowMsg("当前凭证没有计量清单，请修正后继续！");
                return false;
            }
            DataView list = this.bindingSource2.List as DataView;
            IEnumerator enumerator = list.GetEnumerator();
            {
                while (enumerator.MoveNext())
                {
                    DataRowView current = (DataRowView)enumerator.Current;
                    string str3 = current.Row["bqjls"].ToString();
                    if (str3.Equals("0") || str3.Equals(""))
                    {
                        goto Label_011C;
                    }
                }
                goto Label_0143;
            Label_011C:
                MsgBox.ShowMsg("计量清单的[本期计量数量]不能为零，请修正后继续！");
                return false;
            }
        Label_0143:
            return true;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer1 != null))
            {
                this.icontainer1.Dispose();
            }
            base.Dispose(disposing);
        }

        private void GgxUfExf5(object sender, EventArgs e)
        {
            if (this._flag1)
            {
                this.method4("");
                this.method12();
            }
        }

        private void gridControl1_DoubleClick(object sender, EventArgs e)
        {
            this.method18();
        }

        private void gridQDJL_CT_DoubleClick(object sender, EventArgs e)
        {
        }

        private void gridView2_DoubleClick(object sender, EventArgs e)
        {
            this.LfoCoObmo();
        }

        private void InitializeComponent()
        {
            this.icontainer1 = new Container();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmBGJL));
            this.repositoryItemTextEdit2 = new RepositoryItemTextEdit();
            this.groupControl1 = new GroupControl();
            this.trJLQD = new TreeList();
            this.colCBMC = new TreeListColumn();
            this.colID = new TreeListColumn();
            this.colQDBH1 = new TreeListColumn();
            this.colHTSL = new TreeListColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.colZBDJ = new TreeListColumn();
            this.colHTJE = new TreeListColumn();
            this.bindingSource7 = new BindingSource(this.icontainer1);
            this.dataSets1 = new HuaWei.Common.dataSets1();
            this.repositoryItemImageComboBox2 = new RepositoryItemImageComboBox();
            this.imageList = new ImageList(this.icontainer1);
            this.mtgaywZhr = new PanelControl();
            this.gridControl = new GridControl();
            this.bindingSource2 = new BindingSource(this.icontainer1);
            this.gridView2 = new GridView();
            this.colQDBH = new GridColumn();
            this.colXMMC = new GridColumn();
            this.colDW = new GridColumn();
            this.colBQJLS = new GridColumn();
            this.repositoryItemTextEdit3 = new RepositoryItemTextEdit();
            this.gridColumn1 = new GridColumn();
            this.splitterControl2 = new SplitterControl();
            this.panelControl4 = new PanelControl();
            this.gridControl3 = new GridControl();
            this.bindingSource5 = new BindingSource(this.icontainer1);
            this.gridView1 = new GridView();
            this.colBDS = new GridColumn();
            this.colJSS = new GridColumn();
            this.colJSJG = new GridColumn();
            this.groupControl3 = new GroupControl();
            this.memoEdit1 = new MemoEdit();
            this.bindingSource = new BindingSource(this.icontainer1);
            this.groupControl2 = new GroupControl();
            this.pictureEdit1 = new PictureEdit();
            this.panelControl1 = new PanelControl();
            this.labelControl6 = new LabelControl();
            this.labelControl7 = new LabelControl();
            this.labelControl5 = new LabelControl();
            this.labelControl4 = new LabelControl();
            this.edtBGTH = new TextEdit();
            this.ceTYSB = new CheckEdit();
            this.textEdit = new TextEdit();
            this.labelControl3 = new LabelControl();
            this.labelControl2 = new LabelControl();
            this.lblBGLH = new LabelControl();
            this.edtBGLH = new TextEdit();
            this.edtBW = new TextEdit();
            this.edtPZBH = new TextEdit();
            this.edtTZBH = new TextEdit();
            this.edtQQZH = new TextEdit();
            this.panelControl3 = new PanelControl();
            this.groupControl6 = new GroupControl();
            this.gridControl5 = new GridControl();
            this.bindingSource3 = new BindingSource(this.icontainer1);
            this.cardView2 = new CardView();
            this.colQDMC = new GridColumn();
            this.colHTSL1 = new GridColumn();
            this.colBGZJL = new GridColumn();
            this.colBGHSL = new GridColumn();
            this.iAnFljdXyH = new GridColumn();
            this.colSQMJL = new GridColumn();
            this.colBQJL = new GridColumn();
            this.colBQMJL = new GridColumn();
            this.groupControl4 = new GroupControl();
            this.gridControl1 = new GridControl();
            this.bindingSource4 = new BindingSource(this.icontainer1);
            this.cardView1 = new CardView();
            this.colCT = new GridColumn();
            this.repositoryItemPictureEdit1 = new RepositoryItemPictureEdit();
            this.repositoryItemImageComboBox1 = new RepositoryItemImageComboBox();
            this.groupControl5 = new GroupControl();
            this.gridControl2 = new GridControl();
            this.bindingSource8 = new BindingSource(this.icontainer1);
            this.gridView3 = new GridView();
            this.colMC = new GridColumn();
            this.colSL = new GridColumn();
            this.xtraTabControl2 = new XtraTabControl();
            this.xtraTabPage4 = new XtraTabPage();
            this.panelControl7 = new PanelControl();
            this.bindingNavigator2 = new BindingNavigator(this.icontainer1);
            this.toolStripLabel1 = new ToolStripLabel();
            this.toolStripButton4 = new ToolStripButton();
            this.toolStripButton5 = new ToolStripButton();
            this.toolStripSeparator1 = new ToolStripSeparator();
            this.toolStripTextBox1 = new ToolStripTextBox();
            this.toolStripSeparator2 = new ToolStripSeparator();
            this.toolStripButton6 = new ToolStripButton();
            this.toolStripButton7 = new ToolStripButton();
            this.toolStripSeparator3 = new ToolStripSeparator();
            this.toolStripButton8 = new ToolStripButton();
            this.toolStripSeparator4 = new ToolStripSeparator();
            this.toolStripButton1 = new ToolStripButton();
            this.toolStripSeparator7 = new ToolStripSeparator();
            this.toolStripButton9 = new ToolStripButton();
            this.toolStripSeparator5 = new ToolStripSeparator();
            this.toolStripButton10 = new ToolStripButton();
            this.toolStripSeparator6 = new ToolStripSeparator();
            this.splitterControl3 = new SplitterControl();
            this.xtraTabPage3 = new XtraTabPage();
            this.gridQDJL_CT = new GridControl();
            this.bindingSource1 = new BindingSource(this.icontainer1);
            this.cardView3 = new CardView();
            this.colQQZH = new GridColumn();
            this.colTZBH = new GridColumn();
            this.colBW = new GridColumn();
            this.colPZBH = new GridColumn();
            this.colCT1 = new GridColumn();
            this.repositoryItemPictureEdit2 = new RepositoryItemPictureEdit();
            this.toolTipController = new ToolTipController(this.icontainer1);
            this.panelControl5 = new PanelControl();
            this.buttonEdit = new ButtonEdit();
            this.bindingSource6 = new BindingSource(this.icontainer1);
            this.layoutControlItem8 = new LayoutControlItem();
            base.ds.BeginInit();
            base.dsQuery.BeginInit();
            base.dataSets.BeginInit();
            this.repositoryItemTextEdit2.BeginInit();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.trJLQD.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            ((ISupportInitialize)this.bindingSource7).BeginInit();
            this.dataSets1.BeginInit();
            this.repositoryItemImageComboBox2.BeginInit();
            this.mtgaywZhr.BeginInit();
            this.mtgaywZhr.SuspendLayout();
            this.gridControl.BeginInit();
            ((ISupportInitialize)this.bindingSource2).BeginInit();
            this.gridView2.BeginInit();
            this.repositoryItemTextEdit3.BeginInit();
            this.panelControl4.BeginInit();
            this.panelControl4.SuspendLayout();
            this.gridControl3.BeginInit();
            ((ISupportInitialize)this.bindingSource5).BeginInit();
            this.gridView1.BeginInit();
            this.groupControl3.BeginInit();
            this.groupControl3.SuspendLayout();
            this.memoEdit1.Properties.BeginInit();
            ((ISupportInitialize)this.bindingSource).BeginInit();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            this.pictureEdit1.Properties.BeginInit();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            this.edtBGTH.Properties.BeginInit();
            this.ceTYSB.Properties.BeginInit();
            this.textEdit.Properties.BeginInit();
            this.edtBGLH.Properties.BeginInit();
            this.edtBW.Properties.BeginInit();
            this.edtPZBH.Properties.BeginInit();
            this.edtTZBH.Properties.BeginInit();
            this.edtQQZH.Properties.BeginInit();
            this.panelControl3.BeginInit();
            this.panelControl3.SuspendLayout();
            this.groupControl6.BeginInit();
            this.groupControl6.SuspendLayout();
            this.gridControl5.BeginInit();
            ((ISupportInitialize)this.bindingSource3).BeginInit();
            this.cardView2.BeginInit();
            this.groupControl4.BeginInit();
            this.groupControl4.SuspendLayout();
            this.gridControl1.BeginInit();
            ((ISupportInitialize)this.bindingSource4).BeginInit();
            this.cardView1.BeginInit();
            this.repositoryItemPictureEdit1.BeginInit();
            this.repositoryItemImageComboBox1.BeginInit();
            this.groupControl5.BeginInit();
            this.groupControl5.SuspendLayout();
            this.gridControl2.BeginInit();
            ((ISupportInitialize)this.bindingSource8).BeginInit();
            this.gridView3.BeginInit();
            this.xtraTabControl2.BeginInit();
            this.xtraTabControl2.SuspendLayout();
            this.xtraTabPage4.SuspendLayout();
            this.panelControl7.BeginInit();
            this.panelControl7.SuspendLayout();
            this.bindingNavigator2.BeginInit();
            this.bindingNavigator2.SuspendLayout();
            this.xtraTabPage3.SuspendLayout();
            this.gridQDJL_CT.BeginInit();
            ((ISupportInitialize)this.bindingSource1).BeginInit();
            this.cardView3.BeginInit();
            this.repositoryItemPictureEdit2.BeginInit();
            this.panelControl5.BeginInit();
            this.panelControl5.SuspendLayout();
            this.buttonEdit.Properties.BeginInit();
            ((ISupportInitialize)this.bindingSource6).BeginInit();
            this.layoutControlItem8.BeginInit();
            base.SuspendLayout();
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.DisplayFormat.FormatString = "0.000";
            this.repositoryItemTextEdit2.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.EditFormat.FormatString = "0.000";
            this.repositoryItemTextEdit2.EditFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.groupControl1.Controls.Add(this.trJLQD);
            this.groupControl1.Dock = DockStyle.Left;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x115, 0x2b8);
            this.groupControl1.TabIndex = 0;
            this.groupControl1.Text = "清单信息";
            this.trJLQD.Columns.AddRange(new TreeListColumn[] { this.colCBMC, this.colID, this.colQDBH1, this.colHTSL, this.colZBDJ, this.colHTJE });
            this.trJLQD.DataSource = this.bindingSource7;
            this.trJLQD.Dock = DockStyle.Fill;
            this.trJLQD.ImageIndexFieldName = "";
            this.trJLQD.Location = new Point(2, 0x17);
            this.trJLQD.Name = "trJLQD";
            this.trJLQD.OptionsBehavior.Editable = false;
            this.trJLQD.OptionsView.AutoWidth = false;
            this.trJLQD.OptionsView.ShowIndicator = false;
            this.trJLQD.ParentFieldName = "PID";
            this.trJLQD.PreviewFieldName = "QDMC";
            this.trJLQD.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox2, this.repositoryItemTextEdit1 });
            this.trJLQD.Size = new Size(0x111, 0x29f);
            this.trJLQD.TabIndex = 0;
            this.trJLQD.TreeLineStyle = LineStyle.None;
            this.trJLQD.Click += new EventHandler(this.trJLQD_Click);
            this.trJLQD.DoubleClick += new EventHandler(this.trJLQD_DoubleClick);
            this.colCBMC.Caption = "清单名称";
            this.colCBMC.FieldName = "QDMC";
            this.colCBMC.ImageIndex = 4;
            this.colCBMC.MinWidth = 0x25;
            this.colCBMC.Name = "colCBMC";
            this.colCBMC.OptionsColumn.AllowSort = false;
            this.colCBMC.Visible = true;
            this.colCBMC.VisibleIndex = 1;
            this.colCBMC.Width = 0x69;
            this.colID.FieldName = "ID";
            this.colID.Name = "colID";
            this.colID.OptionsColumn.AllowSort = false;
            this.colQDBH1.Caption = "编号";
            this.colQDBH1.FieldName = "QDBH";
            this.colQDBH1.Name = "colQDBH1";
            this.colQDBH1.OptionsColumn.AllowSort = false;
            this.colQDBH1.Visible = true;
            this.colQDBH1.VisibleIndex = 0;
            this.colQDBH1.Width = 0x24;
            this.colHTSL.Caption = "数量";
            this.colHTSL.ColumnEdit = this.repositoryItemTextEdit1;
            this.colHTSL.FieldName = "HTSL";
            this.colHTSL.Format.FormatString = "0.000";
            this.colHTSL.Format.FormatType = FormatType.Numeric;
            this.colHTSL.Name = "colHTSL";
            this.colHTSL.OptionsColumn.AllowSort = false;
            this.colHTSL.Visible = true;
            this.colHTSL.VisibleIndex = 2;
            this.colHTSL.Width = 0x23;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.colZBDJ.Caption = "单价";
            this.colZBDJ.FieldName = "ZBDJ";
            this.colZBDJ.Format.FormatString = "0.00";
            this.colZBDJ.Format.FormatType = FormatType.Numeric;
            this.colZBDJ.Name = "colZBDJ";
            this.colZBDJ.OptionsColumn.AllowSort = false;
            this.colZBDJ.Visible = true;
            this.colZBDJ.VisibleIndex = 3;
            this.colZBDJ.Width = 0x23;
            this.colHTJE.Caption = "金额";
            this.colHTJE.FieldName = "HTJE";
            this.colHTJE.Format.FormatString = "0";
            this.colHTJE.Format.FormatType = FormatType.Numeric;
            this.colHTJE.Name = "colHTJE";
            this.colHTJE.OptionsColumn.AllowSort = false;
            this.colHTJE.Visible = true;
            this.colHTJE.VisibleIndex = 4;
            this.colHTJE.Width = 0x23;
            this.bindingSource7.DataMember = "JLQD";
            this.bindingSource7.DataSource = this.dataSets1;
            this.dataSets1.DataSetName = "DataSets";
            this.dataSets1.SchemaSerializationMode = SchemaSerializationMode.IncludeSchema;
            this.repositoryItemImageComboBox2.AutoHeight = false;
            this.repositoryItemImageComboBox2.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox2.Name = "repositoryItemImageComboBox2";
            this.imageList.ImageStream = (ImageListStreamer)resources.GetObject("imageList1.ImageStream");
            this.imageList.TransparentColor = Color.Transparent;
            //this.imageList.Images.SetKeyName(0, "MT_16.png");
            //this.imageList.Images.SetKeyName(1, "Available.ico");
            //this.imageList.Images.SetKeyName(2, "Away.ico");
            //this.imageList.Images.SetKeyName(3, "Busy.ico");
            //this.imageList.Images.SetKeyName(4, "Offline.ico");
            this.mtgaywZhr.Controls.Add(this.gridControl);
            this.mtgaywZhr.Controls.Add(this.splitterControl2);
            this.mtgaywZhr.Controls.Add(this.panelControl4);
            this.mtgaywZhr.Controls.Add(this.panelControl1);
            this.mtgaywZhr.Dock = DockStyle.Fill;
            this.mtgaywZhr.Location = new Point(0, 0x1d);
            this.mtgaywZhr.Name = "panelControl2";
            this.mtgaywZhr.Size = new Size(0x420, 0x231);
            this.mtgaywZhr.TabIndex = 6;
            this.gridControl.DataMember = null;
            this.gridControl.DataSource = this.bindingSource2;
            this.gridControl.Dock = DockStyle.Fill;
            this.gridControl.EmbeddedNavigator.Buttons.Append.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.First.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.Last.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.Next.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.NextPage.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.Prev.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.PrevPage.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.Remove.Visible = false;
            this.gridControl.EmbeddedNavigator.CustomButtons.AddRange(new NavigatorCustomButton[] { new NavigatorCustomButton(-1, 6, true, true, "添加", "Add"), new NavigatorCustomButton(-1, 7, true, true, "删除", "Del") });
            this.gridControl.EmbeddedNavigator.TextLocation = NavigatorButtonsTextLocation.None;
            this.gridControl.EmbeddedNavigator.TextStringFormat = "记录数 {0} of {1}";
            this.gridControl.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(this.method21);
            this.gridControl.Location = new Point(2, 0x11e);
            this.gridControl.MainView = this.gridView2;
            this.gridControl.Name = "gridQDList";
            this.gridControl.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit3 });
            this.gridControl.Size = new Size(0x41c, 0x111);
            this.gridControl.TabIndex = 2;
            this.gridControl.Tag = "";
            this.gridControl.UseEmbeddedNavigator = true;
            this.gridControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView2 });
            this.bindingSource2.DataMember = "BGQDJL_MX";
            this.bindingSource2.DataSource = this.dataSets1;
            this.gridView2.Columns.AddRange(new GridColumn[] { this.colQDBH, this.colXMMC, this.colDW, this.colBQJLS, this.gridColumn1 });
            this.gridView2.GridControl = this.gridControl;
            this.gridView2.Name = "gridView2";
            this.gridView2.OptionsCustomization.AllowFilter = false;
            this.gridView2.OptionsCustomization.AllowGroup = false;
            this.gridView2.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView2.OptionsView.ColumnAutoWidth = false;
            this.gridView2.OptionsView.ShowGroupPanel = false;
            this.gridView2.OptionsView.ShowIndicator = false;
            this.gridView2.DoubleClick += new EventHandler(this.gridView2_DoubleClick);
            this.colQDBH.Caption = "清单编号";
            this.colQDBH.FieldName = "QDBH";
            this.colQDBH.Name = "colQDBH";
            this.colQDBH.OptionsColumn.ReadOnly = true;
            this.colQDBH.Tag = "-3";
            this.colQDBH.Visible = true;
            this.colQDBH.VisibleIndex = 0;
            this.colQDBH.Width = 0x51;
            this.colXMMC.Caption = "项目名称";
            this.colXMMC.FieldName = "QDMC";
            this.colXMMC.Name = "colXMMC";
            this.colXMMC.OptionsColumn.ReadOnly = true;
            this.colXMMC.Tag = "-3";
            this.colXMMC.Visible = true;
            this.colXMMC.VisibleIndex = 1;
            this.colXMMC.Width = 360;
            this.colDW.Caption = "单位";
            this.colDW.FieldName = "DW";
            this.colDW.Name = "colDW";
            this.colDW.OptionsColumn.ReadOnly = true;
            this.colDW.Tag = "-3";
            this.colDW.Visible = true;
            this.colDW.VisibleIndex = 2;
            this.colDW.Width = 0x24;
            this.colBQJLS.Caption = "本期计量数量";
            this.colBQJLS.ColumnEdit = this.repositoryItemTextEdit3;
            this.colBQJLS.FieldName = "BQJLS";
            this.colBQJLS.Name = "colBQJLS";
            this.colBQJLS.Visible = true;
            this.colBQJLS.VisibleIndex = 3;
            this.colBQJLS.Width = 0x54;
            this.repositoryItemTextEdit3.AutoHeight = false;
            this.repositoryItemTextEdit3.DisplayFormat.FormatString = "0.000";
            this.repositoryItemTextEdit3.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit3.EditFormat.FormatString = "0.000";
            this.repositoryItemTextEdit3.EditFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit3.Name = "repositoryItemTextEdit3";
            this.gridColumn1.Caption = "变更令号";
            this.gridColumn1.FieldName = "BGLH";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.OptionsColumn.ReadOnly = true;
            this.gridColumn1.Tag = "-3";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 4;
            this.gridColumn1.Width = 0x6d;
            this.splitterControl2.Dock = DockStyle.Top;
            this.splitterControl2.Location = new Point(2, 280);
            this.splitterControl2.Name = "splitterControl2";
            this.splitterControl2.Size = new Size(0x41c, 6);
            this.splitterControl2.TabIndex = 0x12;
            this.splitterControl2.TabStop = false;
            this.panelControl4.Controls.Add(this.gridControl3);
            this.panelControl4.Controls.Add(this.groupControl3);
            this.panelControl4.Controls.Add(this.groupControl2);
            this.panelControl4.Dock = DockStyle.Top;
            this.panelControl4.Location = new Point(2, 0x69);
            this.panelControl4.Name = "panelControl4";
            this.panelControl4.Size = new Size(0x41c, 0xaf);
            this.panelControl4.TabIndex = 0x10;
            this.gridControl3.DataMember = null;
            this.gridControl3.DataSource = this.bindingSource5;
            this.gridControl3.Dock = DockStyle.Fill;
            this.gridControl3.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.First.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Last.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Next.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.NextPage.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Prev.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.PrevPage.Visible = false;
            this.gridControl3.EmbeddedNavigator.TextLocation = NavigatorButtonsTextLocation.None;
            this.gridControl3.EmbeddedNavigator.TextStringFormat = "记录数 {0} of {1}";
            this.gridControl3.Location = new Point(0x23f, 2);
            this.gridControl3.MainView = this.gridView1;
            this.gridControl3.Name = "gridControl3";
            this.gridControl3.Size = new Size(0x1db, 0xab);
            this.gridControl3.TabIndex = 1;
            this.gridControl3.Tag = "";
            this.gridControl3.UseEmbeddedNavigator = true;
            this.gridControl3.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1 });
            this.bindingSource5.DataMember = "BGQDJL_JSS";
            this.bindingSource5.DataSource = this.dataSets1;
            this.bindingSource5.AddingNew += new AddingNewEventHandler(this.bindingSource5_AddingNew);
            this.gridView1.Columns.AddRange(new GridColumn[] { this.colBDS, this.colJSS, this.colJSJG });
            this.gridView1.GridControl = this.gridControl3;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsCustomization.AllowFilter = false;
            this.gridView1.OptionsCustomization.AllowSort = false;
            this.gridView1.OptionsView.ColumnAutoWidth = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.colBDS.Caption = "表达式";
            this.colBDS.FieldName = "BDS";
            this.colBDS.Name = "colBDS";
            this.colBDS.Visible = true;
            this.colBDS.VisibleIndex = 0;
            this.colJSS.Caption = "计算式";
            this.colJSS.FieldName = "JSS";
            this.colJSS.Name = "colJSS";
            this.colJSS.Visible = true;
            this.colJSS.VisibleIndex = 1;
            this.colJSS.Width = 0x6f;
            this.colJSJG.Caption = "计算结果";
            this.colJSJG.ColumnEdit = this.repositoryItemTextEdit2;
            this.colJSJG.FieldName = "JSJG";
            this.colJSJG.Name = "colJSJG";
            this.colJSJG.Visible = true;
            this.colJSJG.VisibleIndex = 2;
            this.groupControl3.Controls.Add(this.memoEdit1);
            this.groupControl3.Dock = DockStyle.Left;
            this.groupControl3.Location = new Point(0x1b3, 2);
            this.groupControl3.Name = "groupControl3";
            this.groupControl3.Size = new Size(140, 0xab);
            this.groupControl3.TabIndex = 2;
            this.groupControl3.Text = "图形尺寸";
            this.memoEdit1.DataBindings.Add(new Binding("EditValue", this.bindingSource, "CC", true));
            this.memoEdit1.Dock = DockStyle.Fill;
            this.memoEdit1.Location = new Point(2, 0x17);
            this.memoEdit1.Name = "memoEdit1";
            this.memoEdit1.Size = new Size(0x88, 0x92);
            this.memoEdit1.TabIndex = 3;
            this.bindingSource.DataMember = "BGQDJL_M";
            this.bindingSource.DataSource = this.dataSets1;
            this.bindingSource.PositionChanged += new EventHandler(this.bindingSource_PositionChanged1);
            this.groupControl2.Controls.Add(this.pictureEdit1);
            this.groupControl2.Dock = DockStyle.Left;
            this.groupControl2.Location = new Point(2, 2);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(0x1b1, 0xab);
            this.groupControl2.TabIndex = 1;
            this.groupControl2.Text = "计量草图及几何尺寸（双击清空图片）";
            this.pictureEdit1.Dock = DockStyle.Fill;
            this.pictureEdit1.Location = new Point(2, 0x17);
            this.pictureEdit1.Name = "pictureEdit1";
            this.pictureEdit1.Size = new Size(0x1ad, 0x92);
            this.pictureEdit1.TabIndex = 0;
            this.pictureEdit1.DoubleClick += new EventHandler(this.pictureEdit1_DoubleClick);
            this.panelControl1.Controls.Add(this.labelControl6);
            this.panelControl1.Controls.Add(this.labelControl7);
            this.panelControl1.Controls.Add(this.labelControl5);
            this.panelControl1.Controls.Add(this.labelControl4);
            this.panelControl1.Controls.Add(this.edtBGTH);
            this.panelControl1.Controls.Add(this.ceTYSB);
            this.panelControl1.Controls.Add(this.textEdit);
            this.panelControl1.Controls.Add(this.labelControl3);
            this.panelControl1.Controls.Add(this.labelControl2);
            this.panelControl1.Controls.Add(this.lblBGLH);
            this.panelControl1.Controls.Add(this.edtBGLH);
            this.panelControl1.Controls.Add(this.edtBW);
            this.panelControl1.Controls.Add(this.edtPZBH);
            this.panelControl1.Controls.Add(this.edtTZBH);
            this.panelControl1.Controls.Add(this.edtQQZH);
            this.panelControl1.Dock = DockStyle.Top;
            this.panelControl1.Location = new Point(2, 2);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Size = new Size(0x41c, 0x67);
            this.panelControl1.TabIndex = 0x13;
            this.labelControl6.Location = new Point(0x11f, 0x4d);
            this.labelControl6.Name = "labelControl6";
            this.labelControl6.Size = new Size(0x60, 14);
            this.labelControl6.TabIndex = 0x1a;
            this.labelControl6.Text = "中间交工证书编号";
            this.labelControl7.Location = new Point(15, 0x4d);
            this.labelControl7.Name = "labelControl7";
            this.labelControl7.Size = new Size(0x30, 14);
            this.labelControl7.TabIndex = 0x19;
            this.labelControl7.Text = "变更图号";
            this.labelControl5.Location = new Point(0x11f, 0x36);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x18, 14);
            this.labelControl5.TabIndex = 0x18;
            this.labelControl5.Text = "部位";
            this.labelControl4.Location = new Point(15, 0x36);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(0x30, 14);
            this.labelControl4.TabIndex = 0x17;
            this.labelControl4.Text = "原图编号";
            this.edtBGTH.DataBindings.Add(new Binding("EditValue", this.bindingSource, "BGTH", true));
            this.edtBGTH.Location = new Point(0x45, 0x4a);
            this.edtBGTH.Name = "edtBGTH";
            this.edtBGTH.Size = new Size(200, 0x15);
            this.edtBGTH.TabIndex = 0x15;
            this.ceTYSB.DataBindings.Add(new Binding("EditValue", this.bindingSource, "TYSB", true));
            this.ceTYSB.EditValue = 0;
            this.ceTYSB.Location = new Point(0x287, 7);
            this.ceTYSB.Name = "ceTYSB";
            this.ceTYSB.Properties.Caption = "同意上报";
            this.ceTYSB.Properties.DisplayValueChecked = "1";
            this.ceTYSB.Properties.DisplayValueUnchecked = "0";
            this.ceTYSB.Properties.EditValueChangedFiringMode = EditValueChangedFiringMode.Buffered;
            this.ceTYSB.Properties.ValueChecked = 1;
            this.ceTYSB.Properties.ValueUnchecked = 0;
            this.ceTYSB.Size = new Size(0x52, 0x13);
            this.ceTYSB.TabIndex = 15;
            this.ceTYSB.Tag = "-1";
            this.ceTYSB.EditValueChanging += new ChangingEventHandler(this.ceTYSB_EditValueChanging);
            this.textEdit.DataBindings.Add(new Binding("EditValue", this.bindingSource, "ZJJGZSBH", true));
            this.textEdit.Location = new Point(0x185, 0x4a);
            this.textEdit.Name = "textEdit11";
            this.textEdit.Size = new Size(0x148, 0x15);
            this.textEdit.TabIndex = 13;
            this.labelControl3.Location = new Point(0x11f, 0x1f);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(0x30, 14);
            this.labelControl3.TabIndex = 0x16;
            this.labelControl3.Text = "起讫桩号";
            this.labelControl2.Location = new Point(15, 0x1f);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x30, 14);
            this.labelControl2.TabIndex = 0x15;
            this.labelControl2.Text = "凭证编号";
            this.lblBGLH.Appearance.ForeColor = Color.DodgerBlue;
            this.lblBGLH.Appearance.Options.UseForeColor = true;
            this.lblBGLH.Location = new Point(15, 8);
            this.lblBGLH.Name = "lblBGLH";
            this.lblBGLH.Size = new Size(0x6a, 14);
            this.lblBGLH.TabIndex = 20;
            this.lblBGLH.Text = "变更令号(单击选择)";
            this.lblBGLH.Click += new EventHandler(this.lblBGLH_Click);
            this.edtBGLH.DataBindings.Add(new Binding("EditValue", this.bindingSource, "BGLH", true));
            this.edtBGLH.Location = new Point(0x7f, 5);
            this.edtBGLH.Name = "edtBGLH";
            this.edtBGLH.Properties.ReadOnly = true;
            this.edtBGLH.Size = new Size(0x1f6, 0x15);
            this.edtBGLH.TabIndex = 0x13;
            this.edtBGLH.Tag = "-3";
            this.edtBW.DataBindings.Add(new Binding("EditValue", this.bindingSource, "BW", true));
            this.edtBW.Location = new Point(0x155, 0x33);
            this.edtBW.Name = "edtBW";
            this.edtBW.Size = new Size(0x178, 0x15);
            this.edtBW.TabIndex = 10;
            this.edtPZBH.DataBindings.Add(new Binding("EditValue", this.bindingSource, "PZBH", true));
            this.edtPZBH.Location = new Point(0x45, 0x1c);
            this.edtPZBH.Name = "edtPZBH";
            this.edtPZBH.Size = new Size(200, 0x15);
            this.edtPZBH.TabIndex = 0;
            this.edtTZBH.DataBindings.Add(new Binding("EditValue", this.bindingSource, "TZBH", true));
            this.edtTZBH.Location = new Point(0x45, 0x33);
            this.edtTZBH.Name = "edtTZBH";
            this.edtTZBH.Size = new Size(200, 0x15);
            this.edtTZBH.TabIndex = 9;
            this.edtQQZH.DataBindings.Add(new Binding("EditValue", this.bindingSource, "QQZH", true));
            this.edtQQZH.Location = new Point(0x155, 0x1c);
            this.edtQQZH.Name = "edtQQZH";
            this.edtQQZH.Size = new Size(0x178, 0x15);
            this.edtQQZH.TabIndex = 8;
            this.panelControl3.Controls.Add(this.groupControl6);
            //this.panelControl3.Controls.Add(this.groupControl4);
            this.panelControl3.Controls.Add(this.groupControl5);
            this.panelControl3.Dock = DockStyle.Right;
            this.panelControl3.Location = new Point(0x426, 0);
            this.panelControl3.Name = "panelControl3";
            this.panelControl3.Size = new Size(0xca, 590);
            this.panelControl3.TabIndex = 7;
            this.groupControl6.Controls.Add(this.gridControl5);
            this.groupControl6.Dock = DockStyle.Fill;
            this.groupControl6.Location = new Point(2, 2);
            this.groupControl6.Name = "groupControl6";
            this.groupControl6.Size = new Size(0xc6, 0xcf);
            this.groupControl6.TabIndex = 6;
            this.groupControl6.Text = "详细信息";
            this.gridControl5.DataMember = null;
            this.gridControl5.DataSource = this.bindingSource3;
            this.gridControl5.Dock = DockStyle.Fill;
            this.gridControl5.Location = new Point(2, 0x17);
            this.gridControl5.MainView = this.cardView2;
            this.gridControl5.Name = "gridControl5";
            this.gridControl5.Size = new Size(0xc2, 0xb6);
            this.gridControl5.TabIndex = 4;
            this.gridControl5.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.cardView2 });
            this.bindingSource3.DataMember = "QDQCHZ";
            this.bindingSource3.DataSource = this.dataSets1;
            this.cardView2.CardWidth = 150;
            this.cardView2.Columns.AddRange(new GridColumn[] { this.colQDMC, this.colBGZJL, this.iAnFljdXyH, this.colSQMJL, this.colBQJL, this.colBQMJL });
            this.cardView2.FocusedCardTopFieldIndex = 0;
            this.cardView2.GridControl = this.gridControl5;
            this.cardView2.Name = "cardView2";
            this.cardView2.OptionsBehavior.ReadOnly = true;
            this.cardView2.OptionsView.ShowCardCaption = false;
            this.cardView2.OptionsView.ShowQuickCustomizeButton = false;
            this.cardView2.VertScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Auto;
            this.colQDMC.Caption = "清单名称";
            this.colQDMC.FieldName = "QDMC";
            this.colQDMC.Name = "colQDMC";
            this.colHTSL1.Caption = "合同数量";
            this.colHTSL1.FieldName = "HTSL";
            this.colHTSL1.Name = "colHTSL1";
            this.colHTSL1.Visible = true;
            this.colHTSL1.VisibleIndex = 0;
            this.colBGZJL.Caption = "变更增减量";
            this.colBGZJL.FieldName = "BGZJL";
            this.colBGZJL.Name = "colBGZJL";
            this.colBGZJL.Visible = true;
            this.colBGZJL.VisibleIndex = 1;
            this.colBGHSL.Caption = "变更后数量";
            this.colBGHSL.FieldName = "BGHSL";
            this.colBGHSL.Name = "colBGHSL";
            this.colBGHSL.Visible = true;
            this.colBGHSL.VisibleIndex = 2;
            this.iAnFljdXyH.Caption = "上期计量";
            this.iAnFljdXyH.FieldName = "SQJL";
            this.iAnFljdXyH.Name = "colSQJL";
            this.iAnFljdXyH.Visible = true;
            this.iAnFljdXyH.VisibleIndex = 3;
            this.colSQMJL.Caption = "上期末计量";
            this.colSQMJL.FieldName = "SQMJL";
            this.colSQMJL.Name = "colSQMJL";
            this.colSQMJL.Visible = true;
            this.colSQMJL.VisibleIndex = 4;
            this.colBQJL.Caption = "本期计量";
            this.colBQJL.FieldName = "BQJL";
            this.colBQJL.Name = "colBQJL";
            this.colBQMJL.Caption = "本期末计量";
            this.colBQMJL.FieldName = "BQMJL";
            this.colBQMJL.Name = "colBQMJL";
            this.colBQMJL.Visible = true;
            this.colBQMJL.VisibleIndex = 5;
            this.groupControl4.Controls.Add(this.gridControl1);
            this.groupControl4.Dock = DockStyle.Top;
            this.groupControl4.Location = new Point(2, 2);
            this.groupControl4.Name = "groupControl4";
            this.groupControl4.Size = new Size(0xc6, 210);
            this.groupControl4.TabIndex = 4;
            this.groupControl4.Text = "系统草图（双击选草图）";
            this.gridControl1.DataMember = null;
            this.gridControl1.DataSource = this.bindingSource4;
            this.gridControl1.Dock = DockStyle.Fill;
            this.gridControl1.Location = new Point(2, 0x17);
            this.gridControl1.MainView = this.cardView1;
            this.gridControl1.Name = "gridControl1";
            this.gridControl1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemPictureEdit1, this.repositoryItemImageComboBox1 });
            this.gridControl1.Size = new Size(0xc2, 0xb9);
            this.gridControl1.TabIndex = 1;
            this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.cardView1 });
            this.gridControl1.DoubleClick += new EventHandler(this.gridControl1_DoubleClick);
            this.bindingSource4.DataMember = "GCLCT";
            this.bindingSource4.DataSource = this.dataSets1;
            this.cardView1.CardInterval = 4;
            this.cardView1.CardWidth = 100;
            this.cardView1.Columns.AddRange(new GridColumn[] { this.colCT });
            this.cardView1.FocusedCardTopFieldIndex = 0;
            this.cardView1.GridControl = this.gridControl1;
            this.cardView1.MaximumCardColumns = 3;
            this.cardView1.MaximumCardRows = 3;
            this.cardView1.Name = "cardView1";
            this.cardView1.OptionsBehavior.AutoHorzWidth = true;
            this.cardView1.OptionsBehavior.Editable = false;
            this.cardView1.OptionsBehavior.FieldAutoHeight = true;
            this.cardView1.OptionsView.ShowCardCaption = false;
            this.cardView1.OptionsView.ShowFieldCaptions = false;
            this.cardView1.OptionsView.ShowLines = false;
            this.cardView1.OptionsView.ShowQuickCustomizeButton = false;
            this.colCT.ColumnEdit = this.repositoryItemPictureEdit1;
            this.colCT.FieldName = "CT";
            this.colCT.Name = "colCT";
            this.colCT.Visible = true;
            this.colCT.VisibleIndex = 0;
            this.repositoryItemPictureEdit1.Name = "repositoryItemPictureEdit1";
            this.repositoryItemImageComboBox1.AutoHeight = false;
            this.repositoryItemImageComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox1.Name = "repositoryItemImageComboBox1";
            this.groupControl5.Controls.Add(this.gridControl2);
            this.groupControl5.Dock = DockStyle.Bottom;
            this.groupControl5.Location = new Point(2, 0x194);
            this.groupControl5.Name = "groupControl5";
            this.groupControl5.Size = new Size(0xc6, 0xb8);
            this.groupControl5.TabIndex = 5;
            this.groupControl5.Text = "过程数据";
            this.gridControl2.DataMember = null;
            this.gridControl2.DataSource = this.bindingSource8;
            this.gridControl2.Dock = DockStyle.Fill;
            this.gridControl2.Location = new Point(2, 0x17);
            this.gridControl2.MainView = this.gridView3;
            this.gridControl2.Name = "gridControl2";
            this.gridControl2.Size = new Size(0xc2, 0x9f);
            this.gridControl2.TabIndex = 3;
            this.gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView3 });
            this.bindingSource8.DataSource = base.ds;
            this.bindingSource8.Position = 0;
            this.gridView3.Columns.AddRange(new GridColumn[] { this.colMC, this.colSL });
            this.gridView3.GridControl = this.gridControl2;
            this.gridView3.Name = "gridView3";
            this.gridView3.OptionsBehavior.ReadOnly = true;
            this.gridView3.OptionsView.ShowColumnHeaders = false;
            this.gridView3.OptionsView.ShowGroupPanel = false;
            this.colMC.Caption = " ";
            this.colMC.FieldName = "mc";
            this.colMC.Name = "colMC";
            this.colMC.Visible = true;
            this.colMC.VisibleIndex = 0;
            this.colMC.Width = 0x90;
            this.colSL.Caption = " ";
            this.colSL.FieldName = "sl";
            this.colSL.Name = "colSL";
            this.colSL.Visible = true;
            this.colSL.VisibleIndex = 1;
            this.colSL.Width = 0x55;
            this.xtraTabControl2.Dock = DockStyle.Fill;
            this.xtraTabControl2.Location = new Point(0, 0);
            this.xtraTabControl2.LookAndFeel.UseDefaultLookAndFeel = false;
            this.xtraTabControl2.LookAndFeel.UseWindowsXPTheme = true;
            this.xtraTabControl2.Name = "xtraTabControl2";
            this.xtraTabControl2.SelectedTabPage = this.xtraTabPage4;
            this.xtraTabControl2.Size = new Size(0x4f8, 620);
            this.xtraTabControl2.TabIndex = 8;
            this.xtraTabControl2.TabPages.AddRange(new XtraTabPage[] { this.xtraTabPage3, this.xtraTabPage4 });
            this.xtraTabControl2.SelectedPageChanged += new TabPageChangedEventHandler(this.xtraTabControl2_SelectedPageChanged);
            this.xtraTabPage4.Controls.Add(this.mtgaywZhr);
            this.xtraTabPage4.Controls.Add(this.panelControl7);
            this.xtraTabPage4.Controls.Add(this.splitterControl3);
            this.xtraTabPage4.Controls.Add(this.panelControl3);
            this.xtraTabPage4.Name = "xtraTabPage4";
            this.xtraTabPage4.Size = new Size(0x4f0, 590);
            this.xtraTabPage4.Text = "编辑";
            this.panelControl7.Controls.Add(this.bindingNavigator2);
            this.panelControl7.Dock = DockStyle.Top;
            this.panelControl7.Location = new Point(0, 0);
            this.panelControl7.Name = "panelControl7";
            this.panelControl7.Size = new Size(0x420, 0x1d);
            this.panelControl7.TabIndex = 13;
            this.bindingNavigator2.AddNewItem = null;
            this.bindingNavigator2.AutoSize = false;
            this.bindingNavigator2.BindingSource = this.bindingSource;
            this.bindingNavigator2.CanOverflow = false;
            this.bindingNavigator2.CountItem = this.toolStripLabel1;
            this.bindingNavigator2.DeleteItem = null;
            this.bindingNavigator2.Items.AddRange(new ToolStripItem[] { 
                this.toolStripButton4, this.toolStripButton5, this.toolStripSeparator1, this.toolStripTextBox1, this.toolStripLabel1, this.toolStripSeparator2, this.toolStripButton6, this.toolStripButton7, this.toolStripSeparator3, this.toolStripButton8, this.toolStripSeparator4, this.toolStripButton1, this.toolStripSeparator7, this.toolStripButton9, this.toolStripSeparator5, this.toolStripButton10, 
                this.toolStripSeparator6
             });
            this.bindingNavigator2.Location = new Point(2, 2);
            this.bindingNavigator2.MoveFirstItem = this.toolStripButton4;
            this.bindingNavigator2.MoveLastItem = this.toolStripButton7;
            this.bindingNavigator2.MoveNextItem = this.toolStripButton6;
            this.bindingNavigator2.MovePreviousItem = this.toolStripButton5;
            this.bindingNavigator2.Name = "bindingNavigator2";
            this.bindingNavigator2.PositionItem = this.toolStripTextBox1;
            this.bindingNavigator2.RenderMode = ToolStripRenderMode.System;
            this.bindingNavigator2.Size = new Size(0x41c, 0x19);
            this.bindingNavigator2.TabIndex = 0x11;
            this.bindingNavigator2.Text = "bindingNavigator2";
            this.toolStripLabel1.Name = "toolStripLabel1";
            this.toolStripLabel1.Size = new Size(0x20, 0x16);
            this.toolStripLabel1.Text = "/ {0}";
            this.toolStripLabel1.ToolTipText = "总项数";
            this.toolStripButton4.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton4.Image = (Image)resources.GetObject("toolStripButton4.Image");
            this.toolStripButton4.Name = "toolStripButton4";
            this.toolStripButton4.RightToLeftAutoMirrorImage = true;
            this.toolStripButton4.Size = new Size(0x17, 0x16);
            this.toolStripButton4.Tag = "-3";
            this.toolStripButton4.Text = "移到第一条记录";
            this.toolStripButton5.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton5.Image = (Image)resources.GetObject("toolStripButton5.Image");
            this.toolStripButton5.Name = "toolStripButton5";
            this.toolStripButton5.RightToLeftAutoMirrorImage = true;
            this.toolStripButton5.Size = new Size(0x17, 0x16);
            this.toolStripButton5.Tag = "-3";
            this.toolStripButton5.Text = "移到上一条记录";
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new Size(6, 0x19);
            this.toolStripTextBox1.AccessibleName = "位置";
            this.toolStripTextBox1.AutoSize = false;
            this.toolStripTextBox1.Name = "toolStripTextBox1";
            this.toolStripTextBox1.Size = new Size(50, 0x15);
            this.toolStripTextBox1.Tag = "-3";
            this.toolStripTextBox1.Text = "0";
            this.toolStripTextBox1.ToolTipText = "当前位置";
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new Size(6, 0x19);
            this.toolStripButton6.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton6.Image = (Image)resources.GetObject("toolStripButton6.Image");
            this.toolStripButton6.Name = "toolStripButton6";
            this.toolStripButton6.RightToLeftAutoMirrorImage = true;
            this.toolStripButton6.Size = new Size(0x17, 0x16);
            this.toolStripButton6.Tag = "-3";
            this.toolStripButton6.Text = "移到下一条记录";
            this.toolStripButton7.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton7.Image = (Image)resources.GetObject("toolStripButton7.Image");
            this.toolStripButton7.Name = "toolStripButton7";
            this.toolStripButton7.RightToLeftAutoMirrorImage = true;
            this.toolStripButton7.Size = new Size(0x17, 0x16);
            this.toolStripButton7.Tag = "-3";
            this.toolStripButton7.Text = "移到最后一条记录";
            this.toolStripSeparator3.Name = "toolStripSeparator3";
            this.toolStripSeparator3.Size = new Size(6, 0x19);
            this.toolStripButton8.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.toolStripButton8.Image = (Image)resources.GetObject("toolStripButton8.Image");
            this.toolStripButton8.ImageTransparentColor = Color.Magenta;
            this.toolStripButton8.Name = "toolStripButton8";
            this.toolStripButton8.Size = new Size(0x24, 0x16);
            this.toolStripButton8.Tag = "-1";
            this.toolStripButton8.Text = "新建";
            this.toolStripButton8.Click += new EventHandler(this.toolStripButton8_Click);
            this.toolStripSeparator4.Name = "toolStripSeparator4";
            this.toolStripSeparator4.Size = new Size(6, 0x19);
            this.toolStripButton1.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.toolStripButton1.Image = (Image)resources.GetObject("toolStripButton1.Image");
            this.toolStripButton1.ImageTransparentColor = Color.Magenta;
            this.toolStripButton1.Name = "toolStripButton1";
            this.toolStripButton1.Size = new Size(0x24, 0x16);
            this.toolStripButton1.Tag = "-1";
            this.toolStripButton1.Text = "删除";
            this.toolStripButton1.Click += new EventHandler(this.toolStripButton1_Click);
            this.toolStripSeparator7.Name = "toolStripSeparator7";
            this.toolStripSeparator7.Size = new Size(6, 0x19);
            this.toolStripButton9.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.toolStripButton9.Image = (Image)resources.GetObject("toolStripButton9.Image");
            this.toolStripButton9.ImageTransparentColor = Color.Magenta;
            this.toolStripButton9.Name = "toolStripButton9";
            this.toolStripButton9.Size = new Size(60, 0x16);
            this.toolStripButton9.Tag = "-1";
            this.toolStripButton9.Text = "复制新建";
            this.toolStripButton9.Click += new EventHandler(this.toolStripButton9_Click);
            this.toolStripSeparator5.Name = "toolStripSeparator5";
            this.toolStripSeparator5.Size = new Size(6, 0x19);
            this.toolStripButton10.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.toolStripButton10.Image = (Image)resources.GetObject("toolStripButton10.Image");
            this.toolStripButton10.ImageTransparentColor = Color.Magenta;
            this.toolStripButton10.Name = "toolStripButton10";
            this.toolStripButton10.Size = new Size(60, 0x16);
            this.toolStripButton10.Tag = "-2";
            this.toolStripButton10.Text = "过程数据";
            this.toolStripButton10.Click += new EventHandler(this.toolStripButton10_Click);
            this.toolStripSeparator6.Name = "toolStripSeparator6";
            this.toolStripSeparator6.Size = new Size(6, 0x19);
            this.splitterControl3.Dock = DockStyle.Right;
            this.splitterControl3.Location = new Point(0x420, 0);
            this.splitterControl3.Name = "splitterControl3";
            this.splitterControl3.Size = new Size(6, 590);
            this.splitterControl3.TabIndex = 20;
            this.splitterControl3.TabStop = false;
            this.xtraTabPage3.Controls.Add(this.gridQDJL_CT);
            this.xtraTabPage3.Controls.Add(this.panelControl5);
            this.xtraTabPage3.Controls.Add(this.groupControl1);
            this.xtraTabPage3.Name = "xtraTabPage3";
            this.xtraTabPage3.Size = new Size(0x4f0, 0x2b8);
            this.xtraTabPage3.Text = "一览";
            this.gridQDJL_CT.DataSource = this.bindingSource1;
            this.gridQDJL_CT.Dock = DockStyle.Fill;
            this.gridQDJL_CT.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridQDJL_CT.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gridQDJL_CT.Location = new Point(0x115, 0x21);
            this.gridQDJL_CT.MainView = this.cardView3;
            this.gridQDJL_CT.Name = "gridQDJL_CT";
            this.gridQDJL_CT.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemPictureEdit2 });
            this.gridQDJL_CT.Size = new Size(0x3db, 0x297);
            this.gridQDJL_CT.TabIndex = 3;
            this.gridQDJL_CT.ToolTipController = this.toolTipController;
            this.gridQDJL_CT.UseEmbeddedNavigator = true;
            this.gridQDJL_CT.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.cardView3 });
            this.gridQDJL_CT.DoubleClick += new EventHandler(this.gridQDJL_CT_DoubleClick);
            this.bindingSource1.DataSource = base.dsQuery;
            this.bindingSource1.Position = 0;
            this.cardView3.CardInterval = 4;
            this.cardView3.Columns.AddRange(new GridColumn[] { this.colQQZH, this.colTZBH, this.colBW, this.colPZBH, this.colCT1 });
            this.cardView3.FocusedCardTopFieldIndex = 0;
            this.cardView3.GridControl = this.gridQDJL_CT;
            this.cardView3.Name = "cardView3";
            this.cardView3.OptionsBehavior.Editable = false;
            this.cardView3.OptionsBehavior.FieldAutoHeight = true;
            this.cardView3.OptionsView.ShowCardCaption = false;
            this.cardView3.OptionsView.ShowQuickCustomizeButton = false;
            this.cardView3.VertScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Auto;
            this.cardView3.MouseMove += new MouseEventHandler(this.cardView3_MouseMove);
            this.cardView3.DoubleClick += new EventHandler(this.cardView3_DoubleClick);
            this.colQQZH.FieldName = "QQZH";
            this.colQQZH.Name = "colQQZH";
            this.colTZBH.FieldName = "TZBH";
            this.colTZBH.Name = "colTZBH";
            this.colBW.FieldName = "BW";
            this.colBW.Name = "colBW";
            this.colPZBH.Caption = "凭证编号";
            this.colPZBH.FieldName = "PZBH";
            this.colPZBH.Name = "colPZBH";
            this.colPZBH.Visible = true;
            this.colPZBH.VisibleIndex = 1;
            this.colCT1.Caption = "草图";
            this.colCT1.ColumnEdit = this.repositoryItemPictureEdit2;
            this.colCT1.FieldName = "CT";
            this.colCT1.Name = "colCT1";
            this.colCT1.Visible = true;
            this.colCT1.VisibleIndex = 0;
            this.repositoryItemPictureEdit2.Name = "repositoryItemPictureEdit2";
            this.toolTipController.AllowHtmlText = true;
            this.toolTipController.ToolTipType = ToolTipType.SuperTip;
            this.panelControl5.Controls.Add(this.buttonEdit);
            this.panelControl5.Dock = DockStyle.Top;
            this.panelControl5.Location = new Point(0x115, 0);
            this.panelControl5.Name = "panelControl5";
            this.panelControl5.Size = new Size(0x3db, 0x21);
            this.panelControl5.TabIndex = 6;
            this.buttonEdit.Location = new Point(5, 7);
            this.buttonEdit.Name = "btnSearchPJ";
            this.buttonEdit.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Close) });
            this.buttonEdit.Size = new Size(0xd5, 0x15);
            this.buttonEdit.TabIndex = 4;
            this.buttonEdit.Tag = "-1";
            this.buttonEdit.ButtonClick += new ButtonPressedEventHandler(this.buttonEdit_ButtonClick);
            this.buttonEdit.KeyPress += new KeyPressEventHandler(this.buttonEdit_KeyPress);
            this.bindingSource6.DataSource = this.dataSets1;
            this.bindingSource6.Position = 0;
            this.layoutControlItem8.AppearanceItemCaption.Font = new Font("Tahoma", 9f, FontStyle.Underline);
            this.layoutControlItem8.AppearanceItemCaption.ForeColor = Color.Blue;
            this.layoutControlItem8.AppearanceItemCaption.Options.UseFont = true;
            this.layoutControlItem8.AppearanceItemCaption.Options.UseForeColor = true;
            this.layoutControlItem8.CustomizationFormText = "变更令号";
            this.layoutControlItem8.Location = new Point(0, 0x49);
            this.layoutControlItem8.Name = "layoutControlItem8";
            this.layoutControlItem8.Size = new Size(0x10a, 0x19);
            this.layoutControlItem8.Text = "变更令号";
            this.layoutControlItem8.TextSize = new Size(0x60, 14);
            this.layoutControlItem8.TextToControlDistance = 5;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x4f8, 620);
            base.Controls.Add(this.xtraTabControl2);
            base.Name = "FrmBGJL";
            this.Text = "变更计量";
            base.ds.EndInit();
            base.dsQuery.EndInit();
            base.dataSets.EndInit();
            this.repositoryItemTextEdit2.EndInit();
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.trJLQD.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            ((ISupportInitialize)this.bindingSource7).EndInit();
            this.dataSets1.EndInit();
            this.repositoryItemImageComboBox2.EndInit();
            this.mtgaywZhr.EndInit();
            this.mtgaywZhr.ResumeLayout(false);
            this.gridControl.EndInit();
            ((ISupportInitialize)this.bindingSource2).EndInit();
            this.gridView2.EndInit();
            this.repositoryItemTextEdit3.EndInit();
            this.panelControl4.EndInit();
            this.panelControl4.ResumeLayout(false);
            this.gridControl3.EndInit();
            ((ISupportInitialize)this.bindingSource5).EndInit();
            this.gridView1.EndInit();
            this.groupControl3.EndInit();
            this.groupControl3.ResumeLayout(false);
            this.memoEdit1.Properties.EndInit();
            ((ISupportInitialize)this.bindingSource).EndInit();
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.pictureEdit1.Properties.EndInit();
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            this.panelControl1.PerformLayout();
            this.edtBGTH.Properties.EndInit();
            this.ceTYSB.Properties.EndInit();
            this.textEdit.Properties.EndInit();
            this.edtBGLH.Properties.EndInit();
            this.edtBW.Properties.EndInit();
            this.edtPZBH.Properties.EndInit();
            this.edtTZBH.Properties.EndInit();
            this.edtQQZH.Properties.EndInit();
            this.panelControl3.EndInit();
            this.panelControl3.ResumeLayout(false);
            this.groupControl6.EndInit();
            this.groupControl6.ResumeLayout(false);
            this.gridControl5.EndInit();
            ((ISupportInitialize)this.bindingSource3).EndInit();
            this.cardView2.EndInit();
            this.groupControl4.EndInit();
            this.groupControl4.ResumeLayout(false);
            this.gridControl1.EndInit();
            ((ISupportInitialize)this.bindingSource4).EndInit();
            this.cardView1.EndInit();
            this.repositoryItemPictureEdit1.EndInit();
            this.repositoryItemImageComboBox1.EndInit();
            this.groupControl5.EndInit();
            this.groupControl5.ResumeLayout(false);
            this.gridControl2.EndInit();
            ((ISupportInitialize)this.bindingSource8).EndInit();
            this.gridView3.EndInit();
            this.xtraTabControl2.EndInit();
            this.xtraTabControl2.ResumeLayout(false);
            this.xtraTabPage4.ResumeLayout(false);
            this.panelControl7.EndInit();
            this.panelControl7.ResumeLayout(false);
            this.bindingNavigator2.EndInit();
            this.bindingNavigator2.ResumeLayout(false);
            this.bindingNavigator2.PerformLayout();
            this.xtraTabPage3.ResumeLayout(false);
            this.gridQDJL_CT.EndInit();
            ((ISupportInitialize)this.bindingSource1).EndInit();
            this.cardView3.EndInit();
            this.repositoryItemPictureEdit2.EndInit();
            this.panelControl5.EndInit();
            this.panelControl5.ResumeLayout(false);
            this.buttonEdit.Properties.EndInit();
            ((ISupportInitialize)this.bindingSource6).EndInit();
            this.layoutControlItem8.EndInit();
            base.ResumeLayout(false);
        }

        private void lblBGLH_Click(object sender, EventArgs e)
        {
            if (!this.edtPZBH.Properties.ReadOnly)
            {
                this.method19();
            }
        }

        private void LfoCoObmo()
        {
            if ((!this.edtPZBH.Properties.ReadOnly && (this.bindingSource2.List.Count > 0)) && (MsgBox.ShowQuestion("是否删除当前清单?") == System.Windows.Forms.DialogResult.OK))
            {
                decimal num = CHelp.ConvertDecimal(DHelp.GetDataRow(this.bindingSource2)["BQJLS"], 0, 3);
                if (this.method9(0M, num) <= 0M && this.bindingSource3.Current != null)
                {
                    this.bindingSource3.RemoveCurrent();
                }
                DHelp.DelCurRow(this.bindingSource2);
                //this.method20();
            }
        }

        public override void LoadedForm()
        {
            Class28.smethod9(base.ida, this.bindingSource4);
            this.bindingSource7.DataSource = base.dsQuery.Tables["JLQD"];
            this.bindingSource8.DataSource = base.dsQuery.Tables["BGQDJL_MX2"];
            base.SetBindingSource(this.bindingSource, "BGQDJL_M", true);
            base.SetBindingSource(this.bindingSource2, "BGQDJL_MX", false);
            base.SetBindingSource(this.bindingSource5, "BGQDJL_JSS", false);
            this.bindingSource.PositionChanged += new EventHandler(this.bindingSource_PositionChanged);
            this.bindingSource2.PositionChanged += new EventHandler(this.GgxUfExf5);
            base.ds.Tables["BGQDJL_JSS"].ColumnChanging += new DataColumnChangeEventHandler(this.method5);
            base.ds.Tables["BGQDJL_MX"].ColumnChanging += new DataColumnChangeEventHandler(this.method14);
            this.method11();
            this.bindingSource3.DataSource = base.dsQuery.Tables["BGJLQCHZ"];
            this.trJLQD.ExpandAll();
            this.method17();
        }

        public override void LoadingData()
        {
            base.LoadingData();
            base.ds.Clear();
            base.dsQuery.Clear();
            base.ds.Merge(base.ida.ExecuteDataSet("select * from BGQDJL_M " + Class28.YfQclfhSo(base.OldQCID, "") + " order by hvs desc", CommandType.Text, "BGQDJL_M"));
            string str = "select * from BGQDJL_JSS " + Class28.YfQclfhSo(base.OldQCID, "");
            Class39.smethod4(base.ida, base.ds, str, "BGQDJL_JSS", true);
            str = "select * from BGQDJL_MX " + Class28.YfQclfhSo(base.OldQCID, "");
            Class39.smethod4(base.ida, base.ds, str, "BGQDJL_MX", true);
            str = "select a.id,a.qdbh,b.mc,a.bqjls as sl from BGQDJL_mx2 a left join zzjgxx b on a.bdid=b.id where a.bdid='{0}' and a.qcid={1}";
            str = string.Format(str, GParams._BDID, base.OldQCID);
            Class39.smethod4(base.ida, base.dsQuery, str, "BGQDJL_MX2", true);
            //str = CSQL.BGJLQD.Replace("#bdid#", base.OldBDID);
            //base.dsQuery.Merge(base.ida.ExecuteDataSet(str, CommandType.Text, "JLQD"));
            this.method17();
        }

        private bool method1()
        {
            return this._flag1;
        }

        private void method10(string _str2)
        {
            int num = this.bindingSource.Find("id", _str2);
            this.method2(false);
            this.bindingSource.Position = num;
            this.method17();
            this.method11();
            this.method2(true);
        }

        private void method11()
        {
            this.method2(false);
            string objId = DHelp.GetObjId(this.bindingSource);
            this.bindingSource2.Filter = "pid='" + objId + "'";
            this.bindingSource5.Filter = "pid='" + objId + "'";
            this.method2(true);
        }

        private void method12()
        {
            string str = DHelp.GetObjValue(this.bindingSource2, "id", false);
            if (str.Equals(""))
            {
                this.bindingSource8.Filter = "1=2";
            }
            else
            {
                this.bindingSource8.Filter = string.Format("id='{0}'", str);
            }
        }

        private void method13()
        {
            base.Save();
            this.method2(false);
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
            DataTable table = base.ds.Tables["BGQDJL_MX"].DefaultView.ToTable();
            table.TableName = "mxTable";
            DataTable table2 = base.ds.Tables["BGQDJL_JSS"].DefaultView.ToTable();
            table2.TableName = "jssTable";
            DataRow tRow = DHelp.DataAddNew(this.bindingSource, "", "");
            DataTable table1 = base.ds.Tables["BGQDJL_M"];
            string pid = tRow["id"].ToString();
            DHelp.CopyRow(dataRow.ItemArray, tRow, "", "");
            tRow["PZBH"] = "请修改";
            tRow.EndEdit();
            DataTable table3 = base.ds.Tables["BGQDJL_MX"];
            table3.ColumnChanging -= new DataColumnChangeEventHandler(this.method14);
            foreach (DataRow row3 in table.Rows)
            {
                DataRow row4 = table3.NewRow();
                DHelp.CopyRow(row3, row4, pid, "");
                row4["BQJLS"] = 0;
                table3.Rows.Add(row4);
            }
            table3.ColumnChanging += new DataColumnChangeEventHandler(this.method14);
            DataTable table4 = base.ds.Tables["BGQDJL_JSS"];
            foreach (DataRow row3 in table2.Rows)
            {
                DataRow row5 = table4.NewRow();
                DHelp.CopyRow(row3, row5, pid, "");
                table4.Rows.Add(row5);
            }
            this.method10(pid);
            this.method20(tRow);
        }

        private void method14(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column.ColumnName.Equals("BQJLS"))
            {
                decimal num = DHelp.ToDecimal(e.Row["BQJLS"]);
                decimal num2 = DHelp.ToDecimal(e.ProposedValue);
                this.method9(num2, num);
            }
        }

        private void method15(object sender, EventArgs e)
        {
            base.ds.Tables["BGQDJL_MX"].DefaultView.RowFilter = null;
        }

        private void method16(object sender, EventArgs e)
        {
            base.Close();
        }

        private void method17()
        {
            if (this.bindingSource.DataSource != null)
            {
                string key = DHelp.GetObjValue(this.bindingSource, "JLCT", false);
                int num = this.bindingSource4.Find("ctlj", key);
                if (num != -1)
                {
                    this.bindingSource4.Position = num;
                    byte[] buffer = (byte[])DHelp.GetDataRow(this.bindingSource4)["MAXCT"];
                    using (MemoryStream stream = new MemoryStream(buffer))
                    {
                        this.pictureEdit1.Image = Image.FromStream(stream);
                        return;
                    }
                }
                this.pictureEdit1.Image = null;
            }
        }

        private void method18()
        {
            if (!this.ceTYSB.Checked)
            {
                DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
                if (dataRow != null)
                {
                    DataRow row2 = DHelp.GetDataRow(this.bindingSource4);
                    string str = row2["ctlj"].ToString();
                    byte[] buffer = (byte[])row2["MAXCT"];
                    using (MemoryStream stream = new MemoryStream(buffer))
                    {
                        this.pictureEdit1.Image = Image.FromStream(stream);
                    }
                    dataRow["JLCT"] = str;
                }
            }
        }

        private void method19()
        {
            if (this.bindingSource.List.Count > 0)
            {
                base.Save();
                FrmBGLSelect select = new FrmBGLSelect();
                if (select.ShowDialog() == System.Windows.Forms.DialogResult.OK && !string.IsNullOrEmpty(select.objId))
                {
                    DataRow[] rowsBGL = select.dsQuery.Tables["BGL"].Select("ID='" + select.objId + "'");
                    (bindingSource.Current as DataRowView).Row["bglh"] = rowsBGL[0]["bglh"];
                    (bindingSource.Current as DataRowView).Row["QQZH"] = rowsBGL[0]["QQZH"];
                    (bindingSource.Current as DataRowView).Row["TZBH"] = rowsBGL[0]["YTH"];
                    (bindingSource.Current as DataRowView).Row["BGTH"] = rowsBGL[0]["BGTH"];
                    (bindingSource.Current as DataRowView).Row["BW"] = rowsBGL[0]["BW"];
                    (bindingSource.Current as DataRowView).Row["ZJJGZSBH"] = rowsBGL[0]["BGLXH"];
                    this.method20((bindingSource.Current as DataRowView).Row);

                    DataRowCollection rows = select.dsQuery.Tables["BGLQD"].Rows;
                    this.method2(false);
                    string objId = DHelp.GetObjId(this.bindingSource);
                    DataTable table = base.ds.Tables["BGQDJL_MX"];
                    string str2 = "";
                    string str4 = "";
                    foreach (DataRow row in rows)
                    {
                        if (row["IsSelect"].Equals(true))
                        {
                            str2 = row["qdbh"].ToString();
                            str4 = row["BGLH"].ToString();
                            string filterExpression = string.Format("qdbh='{0}'and pid='{2}'", str2, str4, objId);
                            DataRow[] rowArray = base.ds.Tables["BGQDJL_MX"].Select(filterExpression);
                            this.bindingSource2.Find("qdbh", str2);
                            if (rowArray.Length == 0)
                            {
                                DataRow row2 = table.NewRow();
                                row2["PID"] = objId;
                                row2["QDBH"] = row["QDBH"].ToString();
                                row2["QDMC"] = row["QDMC"].ToString();
                                row2["BGLH"] = row["BGLH"].ToString();
                                row2["BGLQDID"] = row["ID"].ToString();
                                row2["DW"] = row["DW"].ToString();
                                row2["BQJLS"] = CHelp.ConvertDecimal(row["sysl"], 0, 3);
                                row2.EndEdit();
                                table.Rows.Add(row2);
                                //this.bindingSource.MoveLast();
                            }
                            //this.method20();
                        }
                    }
                    base.Save();
                    this.method2(true);
                }
            }
        }

        private void method2(bool value)
        {
            this._flag1 = value;
            if (this._flag1)
            {
                this.method12();
                this.method4("");
            }
        }

        private void method20(DataRow row)
        {
            //string str = "";
            //string str2 = "";
            //foreach (DataRowView view in this.bindingSource2.List)
            //{
            //    DataRow row = view.Row;
            //    str2 = "'" + row["bglh"].ToString() + "'";
            //    if (str.Equals(""))
            //    {
            //        str = str2;
            //    }
            //    else
            //    {
            //        str = str + "," + str2;
            //    }
            //}
            this.edtBGLH.Text = row["BGLH"].ToString();
            this.edtQQZH.Text = row["QQZH"].ToString();
            this.edtTZBH.Text = row["TZBH"].ToString();
            this.edtBGTH.Text = row["BGTH"].ToString();
            this.edtBW.Text = row["BW"].ToString();
            //if (!str.Equals(""))
            //{
            //    string sql = string.Format("select * from bgl where bdid='{0}' and bglh in ({1})", GParams._BDID, str);
            //    foreach (DataRow row in DBHelp.GetDt(base.ida, sql, "temp").Rows)
            //    {
            //        if (this.edtBGLH.Text.Equals(""))
            //        {
            //            this.edtBGLH.Text = row["BGLH"].ToString();
            //        }
            //        else
            //        {
            //            this.edtBGLH.Text = this.edtBGLH.Text + "," + row["BGLH"].ToString();
            //        }
            //        if (this.edtQQZH.Text.Equals(""))
            //        {
            //            this.edtQQZH.Text = row["QQZH"].ToString();
            //        }
            //        else
            //        {
            //            this.edtQQZH.Text = this.edtQQZH.Text + "," + row["QQZH"].ToString();
            //        }
            //        if (this.edtTZBH.Text.Equals(""))
            //        {
            //            this.edtTZBH.Text = row["YTH"].ToString();
            //        }
            //        else
            //        {
            //            this.edtTZBH.Text = this.edtTZBH.Text + "," + row["YTH"].ToString();
            //        }
            //        if (this.edtBGTH.Text.Equals(""))
            //        {
            //            this.edtBGTH.Text = row["BGTH"].ToString();
            //        }
            //        else
            //        {
            //            this.edtBGTH.Text = this.edtBGTH.Text + "," + row["BGTH"].ToString();
            //        }
            //        if (this.edtBW.Text.Equals(""))
            //        {
            //            this.edtBW.Text = row["BW"].ToString();
            //        }
            //        else
            //        {
            //            this.edtBW.Text = this.edtBW.Text + "," + row["BW"].ToString();
            //        }
            //    }
            //}
        }

        private void method21(object sender, NavigatorButtonClickEventArgs e)
        {
            if (e.Button.Tag.Equals("Add"))
            {
                this.method19();
            }
            else if (e.Button.Tag.Equals("Del"))
            {
                this.LfoCoObmo();
            }
        }

        private void method3()
        {
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource3);
            if (dataRow != null)
            {
                //decimal num = CHelp.ConvertDecimal(dataRow["bghsl"], 0, 0);
                //decimal num2 = CHelp.ConvertDecimal(dataRow["sqmjl"], 0, 0);
                decimal num3 = CHelp.ConvertDecimal(dataRow["bqmjl"], 0, 0);
                decimal num4 = CHelp.ConvertDecimal(dataRow["BGZJL"], 0, 0);
                //if (num2 > ((num * num4) / 100M))
                //{
                //this.colSQMJL.AppearanceCell.BackColor = Color.Red;
                //this.colSQMJL.AppearanceCell.ForeColor = Color.Black;
                //}
                //else
                //{
                //this.colSQMJL.AppearanceCell.BackColor = Color.White;
                //this.colSQMJL.AppearanceCell.ForeColor = Color.Black;
                //}
                if (num3 > num4)
                {
                    this.colBQMJL.AppearanceCell.BackColor = Color.Red;
                    this.colBQMJL.AppearanceCell.ForeColor = Color.Black;
                }
                else
                {
                    this.colBQMJL.AppearanceCell.BackColor = Color.White;
                    this.colBQMJL.AppearanceCell.ForeColor = Color.Black;
                }
            }
        }

        private void method4([Optional, DefaultParameterValue("")] string _str2)
        {
            string str = "";
            if (_str2.Equals(""))
            {
                str = DHelp.GetObjValue(this.bindingSource2, "qdbh", false);
            }
            else
            {
                str = _str2;
            }
            if (str.Equals(""))
            {
                str = "000-000-000";
            }

            if (this.bindingSource3.List.Count > 0)
            {
                this.bindingSource3.Filter = "qdbh='" + str + "'";
            }
            if (this.bindingSource3.List.Count == 0)
            {
                if (base.dsQuery != null && base.dsQuery.Tables["BGJLQCHZ"] != null)
                {
                    base.dsQuery.Tables["BGJLQCHZ"].Clear();
                }
                string str2 = CHelp.smethod(string.Format(CSQL.BGJLQCHZ, new object[] { str, base.OldBDID, base.OldQCID, GParams.QCInfo.JSRQ.Date.ToString() }));
                Class39.smethod4(base.ida, base.dsQuery, str2, "BGJLQCHZ", true);
            }
            this.method3();
        }

        private void method5(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Row.Table.Columns.Contains("JSS") && e.Column.ColumnName.Equals("JSS"))
            {
                string sExpression = e.ProposedValue.ToString();
                if (!sExpression.Equals(""))
                {
                    e.Row["JSJG"] = CHelp.EvalExpress(sExpression);
                }
            }
        }

        private void method6()
        {
            DataRow row = DHelp.DataAddNew(this.bindingSource, "", "");
            row["PZBH"] = "请输入单据号";
            row.EndEdit();
            this.edtPZBH.Focus();
            this.method11();
            DevCCHelp.ControlForm(base.Controls, false, 1);
        }

        private void method7()
        {
            if (!this.ceTYSB.Checked)
            {
                if ((this.bindingSource.List.Count > 0) && (MsgBox.ShowQuestion("是否删除当前计量？") == System.Windows.Forms.DialogResult.OK))
                {
                    while (this.bindingSource2.List.Count > 0)
                    {
                        this.bindingSource2.RemoveCurrent();
                    }
                    while (this.bindingSource5.List.Count > 0)
                    {
                        this.bindingSource5.RemoveCurrent();
                    }
                    this.bindingSource.RemoveCurrent();
                    this.method11();
                }
            }
            else
            {
                MsgBox.ShowMsg("当前单据已同意上报，不能被删除");
            }
        }

        private void method8([Optional, DefaultParameterValue(false)] bool _flag2)
        {
            IDataAccess access = DBHelp.IniIDA();
            string str = Class28.YfQclfhSo(GParams.QCInfo.QCID, "");
            if (this.buttonEdit.Text.Trim() != "")
            {
                string str2 = str;
                str = str2 + " and id in (select pid from BGQDJL_MX " + Class28.YfQclfhSo(GParams.QCInfo.QCID, "") + " and (qdmc like '%" + this.buttonEdit.Text.Trim() + "%') or (qdbh like '%" + this.buttonEdit.Text.Trim() + "%'))";
            }
            string exeStr = "select * from " + CSQL.BGQDJL_M_CT_V + str + " order by PZBH";
            if (base.dsQuery.Tables["BGQDJL_M_CT_V"] != null)
            {
                base.dsQuery.Tables["BGQDJL_M_CT_V"].Clear();
            }
            base.dsQuery.Merge(access.ExecuteDataSet(exeStr, CommandType.Text, "BGQDJL_M_CT_V"));
            this.bindingSource1.DataSource = base.dsQuery.Tables["BGQDJL_M_CT_V"];
            if ((_flag2 && (this.bindingSource1.List.Count == 0)) && (this.buttonEdit.Text.Trim() != ""))
            {
                this.buttonEdit.Text = "";
                this.method8(false);
            }
        }

        private decimal method9(decimal _decimal, decimal _decimal1)
        {
            decimal num = 100M;
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource3);
            if (dataRow != null)
            {
                num = (CHelp.ConvertDecimal(dataRow["bqmjl"], 0, 3) - _decimal1) + _decimal;
                dataRow["bqmjl"] = num;
                dataRow.EndEdit();
            }
            this.method3();
            return num;
        }

        private void pictureEdit1_DoubleClick(object sender, EventArgs e)
        {
            if (!(this.ceTYSB.Checked || (this.bindingSource.List.Count <= 0)))
            {
                this.pictureEdit1.Image = null;
                DHelp.GetDataRow(this.bindingSource)["JLCT"] = "";
            }
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            this.method7();
        }

        private void toolStripButton10_Click(object sender, EventArgs e)
        {
            string objId = DHelp.GetObjId(this.bindingSource);
            base.OpenDataLog("BGQDJL_M", GParams._BDID, GParams.QCInfo.QCID, objId);
        }

        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            this.toolStripTextBox1.Focus();
            this.method6();
        }

        private void toolStripButton9_Click(object sender, EventArgs e)
        {
            this.method13();
        }

        private void trJLQD_Click(object sender, EventArgs e)
        {
        }

        private void trJLQD_DoubleClick(object sender, EventArgs e)
        {
            if ((this.trJLQD.FocusedNode != null) && !((this.xtraTabControl2.SelectedTabPageIndex != 0) || this.trJLQD.FocusedNode.HasChildren))
            {
                DataRow curRow = DHelp.GetCurRow(this.trJLQD);
                this.buttonEdit.Text = curRow["QDMC"].ToString();
                this.method8(false);
            }
        }

        private void xtraTabControl2_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
        {
            if (this.xtraTabControl2.SelectedTabPageIndex.Equals(0))
            {
                this.method8(true);
                if (this.bindingSource.List.Count > 0)
                {
                    string objId = DHelp.GetObjId(this.bindingSource);
                    this.bindingSource1.Position = this.bindingSource1.Find("id", objId);
                }
            }
        }
    }
}

